package bean;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;

public class Konsumen {

    private String noBarang;
    private String noPengirim;
    private String namaPengirim;
    private String alamatPengirim;
    private String noTelpPengirim;
    private String namaPenerima;
    private String alamatPenerima;
    private String noTelpPenerima;

    public String getNamaPengirim() {
        return namaPengirim;
    }

    public void setNamaPengirim(String namaPengirim) {
        this.namaPengirim = namaPengirim;
    }

    public String getAlamatPengirim() {
        return alamatPengirim;
    }

    public void setAlamatPengirim(String alamatPengirim) {
        this.alamatPengirim = alamatPengirim;
    }

    public String getNoTelpPengirim() {
        return noTelpPengirim;
    }

    public void setNoTelpPengirim(String noTelpPengirim) {
        this.noTelpPengirim = noTelpPengirim;
    }

    public String getNamaPenerima() {
        return namaPenerima;
    }

    public void setNamaPenerima(String namaPenerima) {
        this.namaPenerima = namaPenerima;
    }

    public String getAlamatPenerima() {
        return alamatPenerima;
    }

    public void setAlamatPenerima(String alamatPenerima) {
        this.alamatPenerima = alamatPenerima;
    }

    public String getNoTelpPenerima() {
        return noTelpPenerima;
    }

    public void setNoTelpPenerima(String noTelpPenerima) {
        this.noTelpPenerima = noTelpPenerima;
    }

    public ResultSet tampilDataKonsumen() {
        Connection conn = koneksi.Koneksi.open();
        Statement state = null;
        try {
            state = conn.createStatement();
        } catch (SQLException ex) {
            Logger.getLogger(Konsumen.class.getName()).log(Level.SEVERE, null, ex);
        }
        String query = "select * from datakonsumen";
        ResultSet res = null;
        try {
            res = state.executeQuery(query);
        } catch (SQLException ex) {
            Logger.getLogger(Konsumen.class.getName()).log(Level.SEVERE, null, ex);
        }
        return res;
    }

    public String getNoPengirim() {
        return noPengirim;
    }

    public void setNoPengirim(String noPengirim) {
        this.noPengirim = noPengirim;
    }

    public String getNoBarang() {
        return noBarang;
    }

    public void setNoBarang(String noBarang) {
        this.noBarang = noBarang;
    }
}
